package com.zhiqianbao.utils;

import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.zhiqianbao.entity.User;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Liang on 2015/12/18.
 */
public class Constants {
    public static  String APP_NAME="mimidai.apk";
    public static final String FILE_DIR_NAME="mimidai_apk";

    public static LocationClient LOCATION_CLIENT = null;
    public static BDLocationListener LOCATION_LISTENER = null;
    public static BDLocation BD_LOCATION = null;
////真信正式的
    public static String CLIENT_APP_ID = "55e3e58c59fb43b3b67fe8e02236cb6e";
    public static String CLIENT_APP_SECRET = "2fb7ab67b24e46f899c2587da417885a";
    //真信开关
    public static String TEXTORTRUE = "0";//0是测试，1是正式
    //真信测试的
    public static String CLIENT_APP_ID_TEXT = "11037e451d944603a04ef1ca4ff8cbd4";
    public static String CLIENT_APP_SECRET_TEXT = "SCUZS2NTW0MHH4Y860MXACTXIRH7J1QK";

    public static final String HTTP_ERROR_MESSAGE = "连接超时";

    public static final String SHARE_CONTENT = "500至5000元的无抵押信用贷款，极速放款。米米贷，信用创造未来，我们最懂你。";
    public static final String SHARE_URL = "http://www.mimidai.com/phone/borrow";
    /**
     * 双击监听最大时间间隔（超过它视为两次单击）
     */
    public static final int DOUBLE_CLICKED_MAXTIME = 800;
    //public static final String SHARE_URL = "http://www.mimidai.com/app/mimidai.apk";

    /**
     * 请求短信接口凭证
     */
    public static String SMS_CODE_TOKEN;
    /**
     * 真人拍照与身份证照片匹配置信度
     */
    public static final float FACE_CERT_CONFIDENCE = 0.5F;

   // public static YWIMKit mIMKit;
    /**
     * 缓存当前登录用户
     */
    public static User LOGIN_USER;
    /**
     * 缓存设备uuid
     */
    public static final String UUID = java.util.UUID.randomUUID().toString().replace("-", "");

    /**
     * 是否启动
     */
    public static boolean IS_START = false;
    //豌豆荚 w001
    public static final String CHANNEL_CODE_WANGDOU = "w001";
    public static final String CHANNEL_CODE_MIMIDAI = "mimidai";
    // 百度
    public static final String CHANNEL_CODE_BAIDU = "b001";
    // 91助手
    public static final String CHANNEL_CODE_91 = "j001";
    //安智
    public static final String CHANNEL_CODE_ANZHI = "a001";
    //应用宝
    public static final String CHANNEL_CODE_YINGYONGBAO = "y001";
    //机锋市场
    public static final String CHANNEL_CODE_JIFENG = "j002";
    //360
    public static final String CHANNEL_CODE_360 = "s001";
    //小米应用
    public static final String CHANNEL_CODE_XIAOMI= "m001";
    //官网
    public static final String CHANNEL_CODE_G001 = "g001";
    //华为
    public static final String CHANNEL_CODE_HUAWEI = "h001";
    //魅族
    public static final String CHANNEL_CODE_MEIZU = "meizu";

    //现金贷——
    public static final String CHANNEL_CODE_XIANJINDAI = "x001";
    //猎球者
    public static final String CHANNEL_CODE_LIEQIUZHE = "l001";
    //第五传媒
    public static final String CHANNEL_CODE_DIWUCHUANMEI = "d001";
    //第五传媒第二渠道
    public static final String CHANNEL_CODE_DIWUCHUANMEI2 = "d002";
    //甘肃鑫网
    public static final String CHANNEL_CODE_GANGSUXINWANG = "gsxw001";
    //甘肃鑫网-002
    public static final String CHANNEL_CODE_GANGSUXINWANG2 = "gsxw002";


    //测试渠道
    public static final String CHANNEL_CODE_TEXT = "test";
    //来借渠道
    public static final String CHANNEL_CODE_LAIJIE = "ljapp001";
    //融翔科技
    public static final String CHANNEL_CODE_RXKJ001 = "rxkj001";
    //乐豆玩
    public static final String CHANNEL_CODE_LDW001= "ldw001";
    //来借钱
    public static final String CHANNEL_CODE_LJQ = "ljq001";
    //小主在线
    public static final String CHANNEL_CODE_XZZX001 = "xzzx001";
    //无忧借款
    public static final String CHANNEL_CODE_WYJK001 = "wyjk001";
    //搜易借
    public static final String CHANNEL_CODE_SYJ001= "syj001";
    //借易得
    public static final String CHANNEL_CODE_JYD001 = "jyd001";
    //来借
    public static final String CHANNEL_CODE_LJ001 = "lj001";
    //CPM
    public static final String CHANNEL_CODE_CPM001 = "cpm001";
    //周易钱庄
    public static final String CHANNEL_CODE_ZYQZ001 = "zyqz001";
    //周易钱庄
    public static final String CHANNEL_CODE_OPPO001 = "oppo001";
    //网贷小猫
    public static final String CHANNEL_CODE_WDXM0001 = "wdxm001";
    //网贷小猫
    public static final String CHANNEL_CODE_SDQZ001 = "sdqz001";
    //秒融超市
    public static final String CHANNEL_CODE_MRCS001 = "mrcs001";
    //木蚂蚁
    public static final String CHANNEL_CODE_MUMAYI = "mmy001";
    //贷贷侠
    public static final String CHANNEL_CODE_DDX001 = "ddx001";
    //闪财宝
    public static final String CHANNEL_CODE_SCB001 = "scb001";
    //广州指乐
    public static final String CHANNEL_CODE_GZZL001 = "gzzl001";
    //汇小贷网
    public static final String CHANNEL_CODE_HXDW001 = "hxdw001";
    //乐视
    public static final String CHANNEL_CODE_LESHI = "leshi";
    //联想
    public static final String CHANNEL_CODE_LIANXIANG = "lianxiang";
    //锤子
    public static final String CHANNEL_CODE_CHUIZI = "chuizi";


    //值得借
    //public static final String CHANNEL_CODE = "zdj001";
    //信花花
    //public static final String CHANNEL_CODE = "xhh001";
    //广州指乐1
    //public static final String CHANNEL_CODE = "gzzl002";
    //百家借
    //public static final String CHANNEL_CODE = "bjj001";
    //钱信
    //public static final String CHANNEL_CODE = "qx001";
    //必须贷
    //public static final String CHANNEL_CODE = "bxd001";
    //vivo
    public static final String CHANNEL_CODE_VIVO001 = "vivo001";
    //借钱用
    //public static final String CHANNEL_CODE = "jqy001";
    //同城贷
    //public static final String CHANNEL_CODE = "tcd001";
    //佰思源科技
    //public static final String CHANNEL_CODE = "bsy";
    //佰思源科技1
    //public static final String CHANNEL_CODE = "bsy001";
    //睿晟传媒-郑冬
    public static final String CHANNEL_CODE = "rscm";


    public static final String MY_PKG_NAME = "com.mimidai";
    public static final String BAIDU_API_KEY = "ESfCRppmykL5kTqhAvbvKOpx7aD3ZCh3";
    public static final String APP_VERSION = "1.1.7";
    public static final Integer APP_CODE = 24;
//    public static String WEB_ROOT = "http://123.124.17.82:8081/mimidai-web";
    //这是正式的web页面
//    public static String WEB_ROOT = "https://www.mimidai.com";
    //这是测试的
//    public static String WEB_ROOT = "";
//        public static String WEB_ROOT = "https://line.mimidai.com/mimidai-web";
//    public static String WEB_ROOT = "http://192.168.1.63:81/mimidai-web";
      public static String WEB_ROOT = "http://192.168.1.60:81/mimidai-web";
//    public static String API_ROOT = "http://192.168.1.251:8080/mimidai-api";
    //正式环境
//     public static String API_ROOT = "https://api.mimidai.com";
//     public static String API_ROOT = "https://api.mimidai.com";
//    public static String API_ROOT = "http://182.92.198.105:8080/mimidai-api";
    //测试环境
    //测试服务器地址
//    public static String API_ROOT = "http://192.168.1.60:81/mimidai-api";
      public static String API_ROOT = "http://59.110.18.85:81/zhiqianbao-api";
//    public static String API_ROOT = "http://123.124.17.82:8081/mimidai-api";
//    public static String API_ROOT = "http://192.168.1.212:8081/mimidai-api";
//    public static String API_ROOT = "http://192.168.1.212:8080/mimidai-api";
//      public static String API_ROOT="";
//      public static String API_ROOT="http://192.168.1.191:8080/mimidai-api";
//        public static String API_ROOT="http://192.168.1.137:8080/mimidai-api";
//        public static String API_ROOT="http://192.168.1.111:8080/mimidai-api";
//      public static String API_ROOT="https://line.mimidai.com/mimidai-api";
//    public static String API_ROOT = "http://192.168.1.189:8080/mimidai-api";
//    public static String API_ROOT = "http://192.168.1.128:8080/mimidai-api";

    //public static String API_ROOT = "http://lxd.tunnel.qydev.com//mimidai-api";
    //public static String API_ROOT = "http://192.168.1.123:8080/mimidai-api";
    //public static  String API_ROOT = "http://192.168.1.127/mimidai-api";

    //苹果
//    public static  String API_ROOT = "http://192.168.1.127/mimidai-api";
//    public static String API_ROOT = "http://192.168.1.199/mimidai-api";
//    public static String API_ROOT = "http://118.192.104.28:8888/mimidai-api";


    //public static String API_ROOT = "http://192.168.1.122:8080/mimidai-api";
    //public static String API_ROOT = "http://api.mimidai.com";
    public static final String DEFAULT_SUCCESS_CODE = "0";
    public static final String DEFAULT_ERRORTIME_CODE = "5";//手机系统时间被修改
    public static final String DEFAULT_ERROR_CODE = "1";
    public static final String DEFAULT_TO_LOGIN_CODE = "9";
    public static final String DEFAULT_VERSION_ERROR_CODE = "10";
    public static final String WX_ID="wxf4bad9a50902c5b3";

    /**
     * 应还款状态
     */
    public static final String BEFORE_REPAYMENT = "0";
    /**
     * 已还款状态
     */
    public static final String AFTER_REPAYMENT = "1";

    /**
     * @Fields STATE_VALID : 未审核状态
     */
    public static final String USER_AUDIT_STATE_NO = "0";
    /**
     * @Fields STATE_INVALID : 审核未通过状态
     */
    public static final String USER_AUDIT_STATE_FAILED = "1";
    /**
     * @Fields STATE_INVALID : 审核通过状态
     */
    public static final String USER_AUDIT_STATE_SUCCESS = "2";

    ///////
    /*

     */
    public static final int REQUEST_CODE_CAPTURE_CAMEIA = 2;

    /////


    /**
     * 刚刚注册
     */
    public static final String USER_STATE_REGIST_INFO = "0";
    /**
     * 完善第一步信息
     */
    public static final String USER_STATE_FIRST_INFO = "1";
    /**
     * 完善第二步信息
     */
    public static final String USER_STATE_SECOND_INFO = "2";
    /**
     * 已完善信息
     */
    public static final String USER_STATE_FINISH_INFO = "3";
    /**
     * 已通过审核
     */
    public static final String USER_STATE_AUDIT_INFO = "4";

    /**
     * 所有银行常量
     */
    public final static List<String> BANKS = new ArrayList<>();


    static {
        BANKS.add("工商银行");
        BANKS.add("建设银行");
        BANKS.add("中国银行");
        BANKS.add("农业银行");
        BANKS.add("交通银行");
        BANKS.add("邮储银行");
        BANKS.add("招商银行");
        BANKS.add("中信银行");
        BANKS.add("浦东发展银行");
        BANKS.add("兴业银行");
        BANKS.add("民生银行");
        BANKS.add("光大银行");
        BANKS.add("平安银行");
        BANKS.add("华夏银行");
        BANKS.add("北京银行");
        BANKS.add("广发银行");
        BANKS.add("上海银行");
        BANKS.add("江苏银行");
    }

    public static final int BASE_ID = 0;
    public static final int RQF_PAY = BASE_ID + 1;
    public static final int RQF_INSTALL_CHECK = RQF_PAY + 1;
    public static final String SERVER_URL = "http://yintong.com.cn/secure_server/x.htm";
    public static final String PAY_PACKAGE = "com.yintong.secure";
    // 银通支付安全支付服务apk的名称，必须与assets目录下的apk名称一致
    public static final String YT_PLUGIN_NAME = "SecurePay.apk";

    public static final String RET_CODE_SUCCESS = "0000";// 0000 交易成功
    public static final String RET_CODE_PROCESS = "2008";// 2008 支付处理中
    public static final String RESULT_PAY_SUCCESS = "SUCCESS";
    public static final String RESULT_PAY_PROCESSING = "PROCESSING";
    public static final String RESULT_PAY_FAILURE = "FAILURE";
    public static final String RESULT_PAY_REFUND = "REFUND";
    //异步通知回调地址
    public static final String NOTIFY_URL = "http://test.yintong.com.cn:80/apidemo/API_DEMO/notifyUrl.htm";

    public static final String IMEI = "imei";
    public static final String IMSI = "imsi";
    public static final String KEY = "key";
    public static final String USER_AGENT = "user_agent";
    public static final String VERSION = "version";
    public static final String DEVICE = "device";
    public static final String SID = "sid";
    public static final String PARTNER = "partner";
    public static final String TRANSCODE = "transcode";
    public static final String CHARSET = "charset";
    public static final String SIGN_TYPE = "sign_type";
    public static final String SIGN = "sign";

    public static final String URL = "URL";
    public static final String SPLIT = "&";

    public static final String ACTION = "action";
    public static final String ACTION_UPDATE = "update";
    public static final String DATA = "data";
    public static final String PLATFORM = "platform";
    /**
     * 婚姻状况
     */
    public final static String CODE_CATEGORY = "Marriage";
    /**
     * 子女状况
     */
    public final static String CODE_CHILDREN = "Children";
    /**
     * 生活半径
     */
    public final static String CODE_LBSRANGE = "LbsRange";
    /**
     * 职位
     */
    public final static String CODE_WORKJOB = "WorkJob";

    /**
     * 工作信息分类
     */
    public final static String CODE_WORKMSG = "WorkMsg";


    public static final String STATE_OK = "1";
    public static final String STATE_CANCEL = "0";

    /**
     * 用户审核类型
     */
    public static final String USER_INFO_AUDIT_TYPE = "1";
    /**
     * 催收贷款类型
     */
    public static final String COLLECTION_LOAN_TYPE = "2";
    /**
     * 附件提醒类型，到添加附件
     */
    public static final String ATTACHMENT_REMIND_TYPE = "3";
    /**
     * 放款成功提醒
     */
    public static final String LOAN_SUCCESS_TYPE = "4";
    /**
     * 借款审核结论提醒
     */
    public static final String LOAN_APPLY_AUDIT_TYPE = "5";
    /**
     * 通知用户换卡
     */
    public static final String NOTICE_USER_CHANGE_CARD_TYPE = "6";
    /**
     * 取消用户放款
     */
    public static final String CANCEL_USER_LOAN_TYPE = "7";

    public static final String CALL_DETAILS_STATUS_DONE = "done";
    public static final String CALL_DETAILS_STATUS_SUSPENDED = "suspended";
    public static final String CALL_DETAILS_STATUS_FAILED = "failed";
    public static final String CALL_DETAILS_STATUS_PROCESSING = "processing";
    //接收到短信验证码后，更新接口进度处理
    public static final String CALL_DETAILS_STATUS_CODEAFTER_PROCESSING = "code_processing";
    public static final String CALL_DETAILS_STATUS_TIMEOUT = "timeout";
    public static final String CALL_DETAILS_STATUS_UPCFAILED = "upcfailed";

    /**
     * @Fields 优惠活动推送
     */
    public static final String PUSH_CRM_ACTIVITY_TYPE = "12";
    /**
     * 需要验证码原因集合
     */
    public static Map<String,String> smsReasonMap = new HashMap<>();
    /**
     * 需要姓名省份证号原因集合
     */
    public static Map<String,String> nameReasonMap = new HashMap<>();
    /**
     * 需要服务密码原因集合
     */
    public static Map<String,String> passwordReasonMap = new HashMap<>();
    /**
     * 失败原因集合
     */
    public static Map<String,String> failMsgMap = new HashMap<>();

    static {
        smsReasonMap.put("SMS","在查询的过程中运营商网站向目标手机下发了短信验证码，请提交该短信验证码");
        smsReasonMap.put("SMSJilinTelecom","吉林电信的用户在查询的时候，需要用目标手机号码编辑短信'cxxd'并发送到10001以获取短信验证码，然后提交该短信验证码");
        smsReasonMap.put("SMSAgain","上次提交的短信验证码有误，请重新提交");
        smsReasonMap.put("newSMS","上次提交的短信验证码有误或已过期，服务器已经下发新的短信验证码,请提交新的短信验证码");
        smsReasonMap.put("loginSMS","在登录过程中运营商网站向目标手机下发了登录短信验证码，请提交此短信验证码");
        smsReasonMap.put("loginSMSAgain","上次提交的登录短信验证码有误，请重新提交");
        smsReasonMap.put("newLoginSMS","上次提交的登录短信验证码或已过期，运营商网站已下发新的登录短信验证码，请提交此短信验证码");
        nameReasonMap.put("nameAndID","创建任务时提供的用户名或身份证有误，导致无法查询用户信息，需要客户重新提供正确的用户名和身份信息任务才能继续");
        passwordReasonMap.put("password","所提供的密码有误，需要重新输入正确的密码");
        passwordReasonMap.put("passwordInOne","密码错误，还有一次重试机会");
        passwordReasonMap.put("passwordInTwo","密码错误，还有两次重试机会");
        passwordReasonMap.put("passwordInThree","密码错误，还有三次重试机会");
        passwordReasonMap.put("passwordInFour","密码错误，还有四次重试机会");
        passwordReasonMap.put("passwordInFive","密码错误，还有五次重试机会");
        passwordReasonMap.put("passwordTooSimple","密码太简单，请重试");
        failMsgMap.put("1000","不支持初始密码登录");
        failMsgMap.put("2000","账号暂时锁定，请稍后再试");
        failMsgMap.put("2001","号码是空号");
        failMsgMap.put("3000","目标服务器发送短信随机码失败");
        failMsgMap.put("3001","短信随机码发送太多，请稍后再试");
        failMsgMap.put("3002","短信随机码验证失败");
        failMsgMap.put("4000","验证用户信息失败");
        failMsgMap.put("4001","非实名认证用户，目标服务器不提供查询");
        failMsgMap.put("5000","目标服务器网络超时");
        failMsgMap.put("5001","目标服务器网络错误");
        failMsgMap.put("6000","目标服务器繁忙");
        failMsgMap.put("6001","目标服务器错误");
        failMsgMap.put("9999","未知错误");
    }
    public static long prevCheckTimeMillis = System.currentTimeMillis();
}
